.class public Lcom/glympse/platform/common/User;
.super Ljava/lang/Object;
.source "User.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/platform/common/User$UserComparator;
    }
.end annotation


# static fields
.field public static final INVALID_USER_ID:J = -0x1L


# instance fields
.field public m_fSelf:Z

.field public m_fTicketsNeedsSorting:Z

.field public m_fltBearingToDegrees:F

.field public m_fltDistanceToMeters:F

.field public m_lCreatedTime:J

.field public m_lElapsed:J

.field public m_lExpireTime:J

.field public m_lUserId:J

.field public m_listTickets:Lcom/glympse/platform/GVector$Tickets;

.field public m_nAvatarVersion:I

.field public m_nAvatarVersionLocal:I

.field public m_nEmailValid:I

.field public m_nPhoneNumberType:I

.field public m_nPin:I

.field public m_nWatching:I

.field protected m_oAvatarScaleCache:Lcom/glympse/platform/ImageScaleCache;

.field public m_oImageAvatar:Lcom/glympse/platform/GImage;

.field public m_oLocPoint:Lcom/glympse/platform/common/LocPoint;

.field public m_oTicketComparitor:Lcom/glympse/platform/common/Ticket$CompareByExpireTime;

.field public m_oTrackServer:Lcom/glympse/platform/common/Track;

.field public m_oUserData:Ljava/lang/Object;

.field public m_strActivity:Ljava/lang/String;

.field public m_strDisplayName:Ljava/lang/String;

.field public m_strEmail:Ljava/lang/String;

.field public m_strPhoneNumber:Ljava/lang/String;

.field public m_strUserId:Ljava/lang/String;

.field public m_strVisibleDisplayName:Ljava/lang/String;


# direct methods
.method public constructor <init>(JLjava/lang/String;)V
    .locals 7
    .parameter "lUserId"
    .parameter "strUserId"

    .prologue
    const-wide/16 v5, 0x0

    const/high16 v4, 0x7fc0

    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 61
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 29
    iput-boolean v2, p0, Lcom/glympse/platform/common/User;->m_fSelf:Z

    .line 30
    const-wide/16 v0, -0x1

    iput-wide v0, p0, Lcom/glympse/platform/common/User;->m_lUserId:J

    .line 31
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strUserId:Ljava/lang/String;

    .line 32
    iput v2, p0, Lcom/glympse/platform/common/User;->m_nPin:I

    .line 33
    iput v2, p0, Lcom/glympse/platform/common/User;->m_nWatching:I

    .line 34
    iput v2, p0, Lcom/glympse/platform/common/User;->m_nAvatarVersion:I

    .line 35
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strDisplayName:Ljava/lang/String;

    .line 36
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strVisibleDisplayName:Ljava/lang/String;

    .line 37
    new-instance v0, Lcom/glympse/platform/common/LocPoint;

    invoke-direct {v0}, Lcom/glympse/platform/common/LocPoint;-><init>()V

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_oLocPoint:Lcom/glympse/platform/common/LocPoint;

    .line 38
    iput v4, p0, Lcom/glympse/platform/common/User;->m_fltDistanceToMeters:F

    .line 39
    iput v4, p0, Lcom/glympse/platform/common/User;->m_fltBearingToDegrees:F

    .line 40
    const-wide v0, 0x7fffffffffffffffL

    iput-wide v0, p0, Lcom/glympse/platform/common/User;->m_lElapsed:J

    .line 41
    iput v2, p0, Lcom/glympse/platform/common/User;->m_nPhoneNumberType:I

    .line 42
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strPhoneNumber:Ljava/lang/String;

    .line 43
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strEmail:Ljava/lang/String;

    .line 44
    iput v2, p0, Lcom/glympse/platform/common/User;->m_nEmailValid:I

    .line 45
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strActivity:Ljava/lang/String;

    .line 46
    iput-wide v5, p0, Lcom/glympse/platform/common/User;->m_lCreatedTime:J

    .line 47
    iput-wide v5, p0, Lcom/glympse/platform/common/User;->m_lExpireTime:J

    .line 49
    iput v2, p0, Lcom/glympse/platform/common/User;->m_nAvatarVersionLocal:I

    .line 50
    iput-object v3, p0, Lcom/glympse/platform/common/User;->m_oImageAvatar:Lcom/glympse/platform/GImage;

    .line 51
    new-instance v0, Lcom/glympse/platform/common/Track;

    invoke-direct {v0}, Lcom/glympse/platform/common/Track;-><init>()V

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_oTrackServer:Lcom/glympse/platform/common/Track;

    .line 52
    new-instance v0, Lcom/glympse/platform/GVector$Tickets;

    invoke-direct {v0}, Lcom/glympse/platform/GVector$Tickets;-><init>()V

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_listTickets:Lcom/glympse/platform/GVector$Tickets;

    .line 53
    new-instance v0, Lcom/glympse/platform/common/Ticket$CompareByExpireTime;

    invoke-direct {v0}, Lcom/glympse/platform/common/Ticket$CompareByExpireTime;-><init>()V

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_oTicketComparitor:Lcom/glympse/platform/common/Ticket$CompareByExpireTime;

    .line 54
    iput-boolean v2, p0, Lcom/glympse/platform/common/User;->m_fTicketsNeedsSorting:Z

    .line 56
    new-instance v0, Lcom/glympse/platform/ImageScaleCache;

    invoke-direct {v0, v3}, Lcom/glympse/platform/ImageScaleCache;-><init>(Lcom/glympse/platform/GImage;)V

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_oAvatarScaleCache:Lcom/glympse/platform/ImageScaleCache;

    .line 58
    iput-object v3, p0, Lcom/glympse/platform/common/User;->m_oUserData:Ljava/lang/Object;

    .line 63
    iput-wide p1, p0, Lcom/glympse/platform/common/User;->m_lUserId:J

    .line 64
    invoke-static {p3}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strUserId:Ljava/lang/String;

    .line 65
    return-void
.end method


# virtual methods
.method public GetAlpha()I
    .locals 6

    .prologue
    const/4 v5, 0x0

    .line 119
    invoke-virtual {p0}, Lcom/glympse/platform/common/User;->IsSelf()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oSentTickets:Lcom/glympse/platform/common/SentTicketList;

    invoke-virtual {v0}, Lcom/glympse/platform/common/SentTicketList;->AnyActive()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 123
    :cond_0
    iget-wide v0, p0, Lcom/glympse/platform/common/User;->m_lElapsed:J

    const-wide/32 v2, 0x493e0

    cmp-long v0, v0, v2

    if-ltz v0, :cond_3

    move v0, v5

    .line 133
    :goto_0
    return v0

    .line 120
    :cond_1
    const-wide/16 v0, 0x0

    iget-wide v2, p0, Lcom/glympse/platform/common/User;->m_lExpireTime:J

    cmp-long v0, v0, v2

    if-eqz v0, :cond_0

    iget-wide v0, p0, Lcom/glympse/platform/common/User;->m_lExpireTime:J

    invoke-static {}, Lcom/glympse/platform/common/CorrectedTime;->GetTime()J

    move-result-wide v2

    cmp-long v0, v0, v2

    if-gtz v0, :cond_0

    .line 133
    :cond_2
    const/4 v0, -0x1

    goto :goto_0

    .line 129
    :cond_3
    const/16 v0, 0xff

    const-wide/high16 v1, 0x4070

    iget-wide v3, p0, Lcom/glympse/platform/common/User;->m_lElapsed:J

    long-to-double v3, v3

    mul-double/2addr v1, v3

    const-wide v3, 0x41124f8000000000L

    div-double/2addr v1, v3

    double-to-int v1, v1

    sub-int/2addr v0, v1

    invoke-static {v5, v0}, Ljava/lang/Math;->max(II)I

    move-result v0

    goto :goto_0
.end method

.method public GetAvatar(II)Lcom/glympse/platform/GBitmap;
    .locals 1
    .parameter "nWidth"
    .parameter "nHeight"

    .prologue
    .line 160
    iget-object v0, p0, Lcom/glympse/platform/common/User;->m_oAvatarScaleCache:Lcom/glympse/platform/ImageScaleCache;

    invoke-virtual {v0, p1, p2}, Lcom/glympse/platform/ImageScaleCache;->GetScaledBitmap(II)Lcom/glympse/platform/GBitmap;

    move-result-object v0

    return-object v0
.end method

.method public GetLocPoint()Lcom/glympse/platform/common/LocPoint;
    .locals 1

    .prologue
    .line 154
    invoke-virtual {p0}, Lcom/glympse/platform/common/User;->IsSelf()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget-object v0, v0, Lcom/glympse/platform/LocManager;->m_oLastLocPoint:Lcom/glympse/platform/common/LocPoint;

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/glympse/platform/common/User;->m_oLocPoint:Lcom/glympse/platform/common/LocPoint;

    goto :goto_0
.end method

.method public GetTicketWithLatestStartTime()Lcom/glympse/platform/common/Ticket;
    .locals 7

    .prologue
    .line 80
    const/4 v2, 0x0

    .line 83
    .local v2, oTicketLatest:Lcom/glympse/platform/common/Ticket;
    iget-object v3, p0, Lcom/glympse/platform/common/User;->m_listTickets:Lcom/glympse/platform/GVector$Tickets;

    invoke-virtual {v3}, Lcom/glympse/platform/GVector$Tickets;->elements()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, iter:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v3

    if-nez v3, :cond_1

    .line 96
    return-object v2

    .line 85
    :cond_1
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/platform/common/Ticket;

    .line 89
    .local v1, oCur:Lcom/glympse/platform/common/Ticket;
    if-eqz v2, :cond_2

    iget-wide v3, v1, Lcom/glympse/platform/common/Ticket;->m_lStartTime:J

    iget-wide v5, v2, Lcom/glympse/platform/common/Ticket;->m_lStartTime:J

    cmp-long v3, v3, v5

    if-lez v3, :cond_0

    .line 91
    :cond_2
    move-object v2, v1

    goto :goto_0
.end method

.method public HasLocation()Z
    .locals 1

    .prologue
    .line 145
    invoke-virtual {p0}, Lcom/glympse/platform/common/User;->GetLocPoint()Lcom/glympse/platform/common/LocPoint;

    move-result-object v0

    invoke-virtual {v0}, Lcom/glympse/platform/common/LocPoint;->HasLocation()Z

    move-result v0

    return v0
.end method

.method public HasPhoneNumber()Z
    .locals 1

    .prologue
    .line 139
    iget-object v0, p0, Lcom/glympse/platform/common/User;->m_strPhoneNumber:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public IsOnline()Z
    .locals 4

    .prologue
    .line 110
    iget-wide v0, p0, Lcom/glympse/platform/common/User;->m_lElapsed:J

    const-wide/32 v2, 0x493e0

    cmp-long v0, v0, v2

    if-gez v0, :cond_2

    .line 111
    invoke-virtual {p0}, Lcom/glympse/platform/common/User;->IsSelf()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oSentTickets:Lcom/glympse/platform/common/SentTicketList;

    invoke-virtual {v0}, Lcom/glympse/platform/common/SentTicketList;->AnyActive()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 112
    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const-wide/16 v0, 0x0

    iget-wide v2, p0, Lcom/glympse/platform/common/User;->m_lExpireTime:J

    cmp-long v0, v0, v2

    if-eqz v0, :cond_0

    iget-wide v0, p0, Lcom/glympse/platform/common/User;->m_lExpireTime:J

    invoke-static {}, Lcom/glympse/platform/common/CorrectedTime;->GetTime()J

    move-result-wide v2

    cmp-long v0, v0, v2

    if-gtz v0, :cond_0

    :cond_2
    const/4 v0, 0x0

    .line 110
    goto :goto_0
.end method

.method public IsSelf()Z
    .locals 1

    .prologue
    .line 102
    iget-boolean v0, p0, Lcom/glympse/platform/common/User;->m_fSelf:Z

    return v0
.end method

.method public SetDisplayName(Ljava/lang/String;)V
    .locals 2
    .parameter "strDisplayName"

    .prologue
    .line 173
    invoke-static {p1}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strDisplayName:Ljava/lang/String;

    .line 176
    invoke-virtual {p0}, Lcom/glympse/platform/common/User;->IsSelf()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 178
    invoke-static {p1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "Me"

    :goto_0
    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strVisibleDisplayName:Ljava/lang/String;

    .line 184
    :goto_1
    return-void

    .line 178
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, " (me)"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 182
    :cond_1
    invoke-static {p1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    const-string v0, "No name"

    :goto_2
    iput-object v0, p0, Lcom/glympse/platform/common/User;->m_strVisibleDisplayName:Ljava/lang/String;

    goto :goto_1

    :cond_2
    move-object v0, p1

    goto :goto_2
.end method

.method public SortTickets()V
    .locals 2

    .prologue
    .line 70
    iget-boolean v0, p0, Lcom/glympse/platform/common/User;->m_fTicketsNeedsSorting:Z

    if-eqz v0, :cond_0

    .line 72
    iget-object v0, p0, Lcom/glympse/platform/common/User;->m_listTickets:Lcom/glympse/platform/GVector$Tickets;

    iget-object v1, p0, Lcom/glympse/platform/common/User;->m_oTicketComparitor:Lcom/glympse/platform/common/Ticket$CompareByExpireTime;

    invoke-virtual {v0, v1}, Lcom/glympse/platform/GVector$Tickets;->Sort(Lcom/glympse/platform/GComparator;)V

    .line 73
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/common/User;->m_fTicketsNeedsSorting:Z

    .line 75
    :cond_0
    return-void
.end method

.method public clearAvatarScaleCache()V
    .locals 2

    .prologue
    .line 166
    iget-object v0, p0, Lcom/glympse/platform/common/User;->m_oAvatarScaleCache:Lcom/glympse/platform/ImageScaleCache;

    iget-object v1, p0, Lcom/glympse/platform/common/User;->m_oImageAvatar:Lcom/glympse/platform/GImage;

    invoke-virtual {v0, v1}, Lcom/glympse/platform/ImageScaleCache;->invalidate(Lcom/glympse/platform/GImage;)V

    .line 167
    return-void
.end method
